import { BaseWindow } from "../../../../../component/window/BaseWindow";
import { ILayer } from "../../../../../mvc/interfaces/ILayer";
import { Language } from "../../../../../../extend/language/Language";
import { LoaderHelp } from "../../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../../resource/ResFileConst";
import { DataProvider } from "../../../../../../fl/data/DataProvider";
import { ItemData } from "../../../../resource/info/ItemData";
import { Dispatcher } from "../../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../../events/DataEvent";
import { EventName } from "../../../../mvc/EventName";
import { ObjCreate } from "../../../common/ObjCreate";
import { GlobalClass } from "../../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../../resource/ImagesConst";
import { ScrollBarDirection } from "../../../../../../fl/controls/ScrollBarDirection";
import { SkillRuneMyHolyRender } from "./SkillRuneMyHolyRender";
import { SkillRuneComposeAComposition } from "./SkillRuneComposeAComposition";
import { GTileList } from "../../../../../../com/mui/controls/GTileList";
import { GComboBox } from "../../../../../../com/mui/controls/GComboBox";
type int = number;
//class SkillRuneComposeWin
    
    export  class SkillRuneComposeWin extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.setSize(567, 483);
            this.title = Language.getString(80071);
            this.titleHeight = 26;
            LoaderHelp.addResCallBack(ResFileConst.rune, this.initView);
            return;
        }

        public get selectedIndex(): int
        {
            return this._selectBox.selectedIndex;
        }

        public set selectedIndex(arg1: int)
        {
            this._selectBox.selectedIndex = arg1;
            return;
        }

        public getCurCategory(): int
        {
            return this._selectBox.selectedIndex;
        }

        public getSelectedItemIndex(): int
        {
            return this._myHolyList.selectedIndex;
        }

        public updateMyHolyList(arg1: DataProvider): void
        {
            this._myHolyList.dataProvider = arg1;
            this._myHolyList.drawNow();
            return;
        }

        public updateCompose(arg1: ItemData): void
        {
            this._aCompose.updateView(arg1);
            return;
        }

        /* internal  */selectedIndexChangedHandler(arg1: Object /* flash.events.Event */): void
        {
            var loc1=this._selectBox.selectedIndex;
            Dispatcher.dispatchEvent(new DataEvent(EventName.RuneMyHolyCategoryIndexChanged));
            return;
        }

        /* internal  */initView(): void
        {
            var loc8=null;
            ObjCreate.createBg(19, 38, 159, 404, this);
            var loc1=ObjCreate.createGTextField("", 30, 44, 120, 20, this);
            loc1.htmlText = Language.getString(80079);
            var loc2=GlobalClass.getBitmap(ImagesConst.SkillRuneHolyRuneComposeBg);
            loc2.x = 182;
            loc2.y = 38;
            this.addChild(loc2);
            ObjCreate.createBg(182, 38, 368, 433, this);
            var loc3=ObjCreate.createGTextField("", 190, 400, 350, 100, this);
            loc3.multiline = true;
            loc3.wordWrap = true;
            var loc4;
            (loc4 = loc3.defaultTextFormat).leading = 5;
            loc3.defaultTextFormat = loc4;
            loc3.htmlText = Language.getString(80075);
            this._myHolyList = ObjCreate.createTileList(19, 63, 155, 375, this);
            this._myHolyList.direction = ScrollBarDirection.VERTICAL;
            this._myHolyList.rowHeight = 54;
            this._myHolyList.columnWidth = 150;
            this._myHolyList.setStyle("cellRenderer", SkillRuneMyHolyRender);
            var loc5=Language.getArray(80078);
            var loc6=new DataProvider();
            var loc7=0;
            while (loc7 < loc5.length) 
            {
                loc8 = loc5[loc7];
                loc6.addItem(loc8);
                ++loc7;
            }
            this._selectBox = ObjCreate.createGComboBox(31, 445, 135, 25, null, this);
            this._selectBox.dataProvider = loc6;
            this._selectBox.addEventListener(flash.events.Event.CHANGE, this.selectedIndexChangedHandler);
            this._aCompose = new SkillRuneComposeAComposition();
            this._aCompose.x = 253;
            this._aCompose.y = 73;
            this.addChild(this._aCompose);
            this._selectBox.addEventListener(flash.events.Event.CHANGE, this.selectedIndexChangedHandler);
            return;
        }

        public static /* const */Selected_All: int=0;

        public static /* const */Selected_Equiped: int=1;

        public static /* const */Selected_Backpack: int=2;

        public static /* const */Selected_ActivedAll: int=3;

        public static /* const */Selected_ActivedPartly: int=4;

        /* internal */ /* var */_myHolyList: GTileList;

        /* internal */ /* var */_selectBox: GComboBox;

        /* internal */ /* var */_aCompose: SkillRuneComposeAComposition;
    }
